package designPattern.singletonPattern;

/**
 * InnerSingleton
 *
 * @author nanxin.chen
 * @date 2015/11/3
 */
public class InnerSingleton {
    private InnerSingleton() {
        System.out.println("create inner singleton.");
    }

    private static class SingletonHodder {
        private static InnerSingleton singleton = new InnerSingleton();
    }

    public static InnerSingleton getInstance() {
        return SingletonHodder.singleton;
    }
}
